Repository navigation
feat(pm-agg): forecast input for quota admission — Stage-3 S4 (#12698) - #13271
Merged
Merged
Conversation
#12698 Design D4: buildQuotaAdmission gains an optional forecasts input, supplied per exact billing scope like observations. A window opts in via forecastMarginMs; a fresh forecast projected from the window's current reading (state projected, wallsBeforeReset, wall at least the margin before reset) adds pace_hold to an otherwise eligible window. Stale, superseded, conflicting or honesty-state forecasts are exactly current behaviour (criterion 3). No forecast input = byte-identical projection. Plus the D4 flag in PM_AGG_STORE_BACKEND posture (quota-admission-forecast-config.ts): PM_AGG_FORECAST_ADMISSION off by default; on requires the one named pool and a positive margin; invalid values throw. Flipping back is the whole rollback. Nothing is enabled by this change; go-live stays gated on S3's shadow week.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage-3 S4 implementation slice for #12698, per design decision D4 (
doc/2026-11-22T22-35-00Z_design_quota-plane-stage-3): the existing quota-admission verdict path now takes the S1 forecast as an input. This is the implementation landing only — nothing is enabled; the go-live stays gated on S3's shadow week (see the progress note on #12698).src/quota-admission.ts—AdmissionInputgains optionalforecastsrows, supplied per exact billing scope exactly like observations (the fleet(pools): enforce monthly pace guards at seating time — steward hard stops are currently advisory and were burned through (cline-pass + both Go monthlies walled) #2732 scope discipline is unchanged; display pool identity is still not accepted). A binding window opts in per-window via a newforecastMarginMspolicy field. The rule, applied only to an otherwise eligible window: the latest forecast row for the window — internally consistent, projected from the window's current reading, still fresh by the same bound the measured path applies to observations — with stateprojected,wallsBeforeReset, and a projected wall at least the configured margin before the reset yieldspace_holdwith reasonforecast_projected_walland the forecast row as evidence. A stale, superseded, conflicting, or honesty-state forecast is exactly current behaviour (impl(quota-plane): stage-3 S4 — live forecast-driven admission: pace_hold from projected exhaustion #12698 criterion 3, pinned by tests). The forecast never overrides a measured verdict and never manufactures evidence for an unknown window.src/quota-admission-forecast-config.ts— the D4 flag in thePM_AGG_STORE_BACKENDposture:PM_AGG_FORECAST_ADMISSIONdefaults tooff(today's behaviour);onrequiresPM_AGG_FORECAST_ADMISSION_POOL(the one named pool) andPM_AGG_FORECAST_ADMISSION_MARGIN_MS(positive integer); invalid values throw. Flipping the flag back is the whole rollback.Evidence
origin/main(4 failures: the D4 hold, the exact-margin hold, duplicate-row hold, invalid-margin policy) before the change.test/quota-admission-forecast.test.ts, oracle = design D4 + criterion 3; 5 intest/quota-admission-forecast-config.test.ts, oracle = D4 flag posture).quota-admission,quota-admission-source,quota-admission-shadowsuites all pass; the no-forecast projection is byte-identical to the pre-S4 output (pinned by test).tsc --noEmitand biome clean on all touched files.origin/mainin the same environment — the failing-file subset re-ran 1 pass / 14 fail on both trees — and 2 are load-timeout flakes in files that do not import the changed module. No failing file importsquota-admission.9fa5ba86804. Remote dispatch attempted first (run 45176376837) failed at the Execute-target-command step — the fleet-build container toolchain gap (fleet: fleet-command dispatch container cannot run nix develop out of the box (experimental features, nixbld group, homeless-shelter purity) #13159 family), an environment failure, not a test result; the laptop run is the verifying route.Merge danger
Default-off and additive: with no
forecastsinput or noforecastMarginMspolicy,buildQuotaAdmissionoutput is unchanged. The only new verdict path requires both caller-supplied forecast rows and per-window margin policy. Rollback is config alone (stop supplying either), or revert.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T12:44:34Z", "session_id": null, "lane": null, "host": "amd", "worktree": "/home/user/wt-lane-ur-12698", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/user/wt-lane-ur-12698", "repo": "developing-today/code", "branch": "lane-ur-12698", "sha": "9fa5ba868046abc0088ebe00a8f64a750cd0616d" }, "auth_subject": "code-g", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.